<?php include $this->admin_tpl('meta', 'admin');?>
<title>统计</title>
<meta name="referrer" content="no-referrer" />
<style>
.label{margin-left:3px;height:20px;line-height:20px;}
</style>
</head>
<body>
<div class="page-container">
<div style="font-size:16px;font-weight:bold;text-align:center"><span class="c-primary">
	<a onclick="layer.load();" href="<?php echo U('trend',['type'=>$type,'days'=>7,'kuan'=>$kuan]);?>"><span class="label <?php if($days==7){ echo 'label-secondary'; }else{ echo 'label-primary'; } ?> radius">近7天</span></a>
	<a onclick="layer.load();" href="<?php echo U('trend',['type'=>$type,'days'=>15,'kuan'=>$kuan]);?>"><span class="label <?php if($days==15){ echo 'label-secondary'; }else{ echo 'label-primary'; } ?> radius">近15天</span></a>
	<a onclick="layer.load();" href="<?php echo U('trend',['type'=>$type,'days'=>30,'kuan'=>$kuan]);?>"><span class="label <?php if($days==30){ echo 'label-secondary'; }else{ echo 'label-primary'; } ?> radius">近30天</span></a>
</div>
</div>
<div id="container" style="height:400px;"></div>
<div style="font-size:14px;font-weight:bold;text-align:center"><span class="c-primary"><?php echo $_GET['kuan'];?></span> - 销量统计</div>
</div>
<?php include $this->admin_tpl('footer', 'admin');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/echarts/echarts.min.js"></script>
<script type="text/javascript">
var myChart = echarts.init(document.getElementById('container'));
    var dom = document.getElementById('container');
    var myChart = echarts.init(dom, null, {
      renderer: 'canvas',
      useDirtyRect: false
    });
    var app = {};
    
    var option;

    option = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: [
    {
      type: 'category',
      data: <?php echo $data;?>,
      axisTick: {
        alignWithLabel: true
      }
    }
  ],
  yAxis: [
    {
      type: 'value'
    }
  ],
  series: [
    {
      name: '销量',
      type: 'bar',
      barWidth: '60%',
      data: <?php echo $qty;?>
    }
  ]
};

    if (option && typeof option === 'object') {
      myChart.setOption(option);
    }
</script> 

</body>
</html>